<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:display="http://www.w3.org/1999/xhtml" xmlns:div.display="http://www.w3.org/1999/xhtml"
      xmlns:row.display="http://www.w3.org/1999/xhtml" lang="en">

<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>applySearch</title>

    <!-- jQuery -->
    <script th:src="@{/vendor/jquery/jquery.min.js}"></script>
    <!-- Bootstrap Core CSS -->
    <link th:href="@{/vendor/bootstrap/css/bootstrap.min.css}"  href="../static/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">

    <!-- MetisMenu CSS -->
    <link th:href="@{/vendor/metisMenu/metisMenu.min.css}" rel="stylesheet">

    <!-- Custom CSS -->
    <link th:href="@{/dist/css/sb-admin-2.css}" rel="stylesheet">


    <script th:src="@{/vendor/bootstrap/js/bootstrap-table.js}"></script>
    <link href="/vendor/bootstrap/css/bootstrap-table.css" rel="stylesheet">
    <link href="/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">

    <!-- Custom Fonts -->
    <link th:href="@{/vendor/font-awesome/css/font-awesome.min.css}" rel="stylesheet" type="text/css">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->


    <style>

        #iframeMapping{
            float: left;
            width: 65%;
            height: 600px;;
        }
    </style>
    <script type="text/javascript">
        $(document).ready(function () {

//        var startDate = $("#startDate").val();
//        var endDate = $("#endDate").val();
//        var personalFlag = $("#personalFlag").val();
//        var status = $("#status").val();
//        var manager = $("#manager").val();
//        var custCod = $("#custCod").val();
//        var lastName = $("#lastname").val();
//        var lregno = $("#lregno").val();

            var Url = '/applySearchSearch?'
                + 'startDate=' + $('#startDate').val()
                + '&endDate=' + $('#endDate').val()
                + '&personalFlag=' + $('#personalFlag').val()
                + '&status=' + $('#status').val()
                + '&manager=' + $('#manager').val()
                + '&custCod=' + $('#custCod').val()
                + '&lastname=' + $('#lastname').val()
                + '&lregno=' + $('#lregno').val();
//            var Url ='/CreditAmountRecheck/Search?startDate=&&endDate=&&obkgid=&&refnum=';

            $('#resultTable').bootstrapTable({
                url: Url,         //请求后台的URL（*）
                method: 'get',                      //请求方式（*）
                toolbar: '#toolbar',                //工具按钮用哪个容器
                striped: true,                      //是否显示行间隔色
                cache: false,                       //是否使用缓存，默认为true，所以一般情况下需要设置一下这个属性（*）
                sortable: false,                     //是否启用排序
                sortOrder: "asc",
                locale: 'zh-CN',                     //中文支持
                pagination: true,                   //是否分页
                sidePagination: 'server',           //指定服务器端分页
                pageNumber: 1,                      //初始化加载第一页，默认第一页
                pageSize: 5,                       //每页的记录行数（*）
                pageList: [5, 10, 15, 50, 100, 'ALL'],        //可供选择的每页的行数（*）
//            height: 256,
                strictSearch: true,                 //搜索
                showColumns: false,                  //是否显示所有的列按钮
                showRefresh: false,                  //是否显示刷新按钮
                minimumCountColumns: 1,             //最少允许的列数
                clickToSelect: true,                //是否启用点击选中行
                uniqueId: "bpm_no",               //每一行的唯一标识，一般为主键列
                showToggle: false,                    //是否显示详细视图和列表视图的切换按钮
                cardView: false,                    //是否显示详细视图
                detailView: false,                   //是否显示父子表
                queryParams: queryParams,//请求服务器时所传的参数
                responseHandler: responseHandler,//请求数据成功后，渲染表格前的方法
                onLoadError:function(result){
                    alert("加载失败");
                },
                onClickRow: onClickRow,
                columns: [{
                    field: 'bpm_no',
                    title: '参考编号'
                }, {
                    field: 'custcode',
                    title: '客户号'
                }, {
                    field: 'lastName',
                    title: '中文名称'
                }, {
                    field: 'status',
                    title: '贷款申请状态'
                }, {
                    field: 'pidno',
                    title: '证件号码'
                }, {
                    field: 'startDate',
                    title: '申请日期'
                }]
            });



            })

        //点击行事件
        function onClickRow(item, $element) {
            $('#iframeMapping').attr('src', "/applySearchResult?custcode=" + item.custcode);
        }


        //请求服务数据时所传参数
        function queryParams(params) {
            return {
                pageSize: params.limit, //每一页的数据行数，默认是上面设置的10(pageSize)
                pageIndex: params.offset / params.limit + 1, //当前页面,默认是上面设置的1(pageNumber)
            }
        }
        //请求成功方法
        function responseHandler(result) {
            var errCode = result.errCode;//在此做了错误代码的判断
            if (errCode != 0) {
                alert("错误代码" + errCode);
                return;
            }
            //如果没有错误则返回数据，渲染表格
            return {
                total: result.dataLength, //总页数,前面的key必须为"total"
                rows: result.rowDatas //行数据，前面的key要与之前设置的dataField的值一致.
            };
        }


        function search()
        {
            var Url = '/applySearchSearch?'
                + 'startDate=' + $('#startDate').val()
                + '&&endDate=' + $('#endDate').val()
                + '&&personalFlag=' + $('#personalFlag').val()
                + '&&status=' + $('#status').val()
                + '&&manager=' + $('#manager').val()
                + '&&custCod=' + $('#custCod').val()
                + '&&lastname=' + $('#lastname').val()
                + '&&lregno=' + $('#lregno').val();
            $('#resultTable').bootstrapTable("refresh", {url: Url});


        }

    </script>


</head>

<body style="overflow-y: scroll; overflow-x: scroll">

<div id="searchbar"  >
    <form   name="guarantee"  >
        <div class="panel panel-default">
            <div class="panel-heading">
                <h4 class="panel-title">
                    <a data-toggle="collapse" data-parent="#accordion" href="#collapseOne">贷款信息查询</a>
                </h4>
            </div>
            <div id="collapseOne" class="panel-collapse collapse in">
                <div class="panel-body">

                    <div class="row" >
                        <div class="col-lg-4">
                            <label >开始日期：</label>
                        </div>
                        <div class="col-lg-8">
                            <div class="input-group date">
                                <div class="input-group-addon">
                                    <i class="fa fa-calendar"></i>
                                </div>
                                <input type="date" class="form-control pull-right datepicker"   id="startDate">
                            </div>
                        </div>
                    </div>

                    <div class="row" >
                        <div class="col-lg-4">
                            <label >结束日期：</label>
                        </div>
                        <div class="col-lg-8">
                            <div class="input-group date">
                                <div class="input-group-addon">
                                    <i class="fa fa-calendar"></i>
                                </div>
                                <input type="date" class="form-control pull-right datepicker"   id="endDate">
                            </div>
                        </div>
                    </div>

                    <div class="row">
                        <div class="col-lg-4">
                            <label >个人企业标志：</label>
                        </div>
                        <div class="col-lg-8">
                            <select id="personalFlag" class="form-control" >
                                <option value="">-</option>
                                <option value="N">企业</option>
                                <option value="Y">个人</option>
                            </select>
                        </div>
                    </div>

                    <div class="row">
                        <div class="col-lg-4">
                            <label >状态：</label>
                        </div>
                        <div class="col-lg-8">
                            <select id="status"  class="form-control"  >
                                <option value="">全部</option>
                                <option value="1">修改抵押信息</option>
                                <option value="2">修改复核信息</option>
                            </select>
                        </div>
                    </div>

                    <div class="row">
                        <div class="col-lg-4">
                            <label >客户经理：</label>
                        </div>
                        <div class="col-lg-8">
                            <select id="manager" class="form-control"    >
                                <!--<option disabled selected value>-</option>-->
                                <option value="">-</option>
                                <option th:each="Type:${applysearch_info.ManagerList}" th:value="${Type.ACCOFFE}" th:text='${Type.ACCOFFE}+${Type.DESCRIP}'></option>
                            </select>
                        </div>
                    </div>

                    <div class="row" >
                        <div class="col-lg-4">
                            <label >客户号：</label>
                        </div>
                        <div class="col-lg-8">
                            <input  id="custCod" type="text" class="form-control"      >
                        </div>
                    </div>

                    <div class="row" >
                        <div class="col-lg-4">
                            <label >中文名称：</label>
                        </div>
                        <div class="col-lg-8">
                            <input id="lastname" type="text" class="form-control" >
                        </div>
                    </div>

                    <div class="row" >
                        <div class="col-lg-4">
                            <label >注册登记号：</label>
                        </div>
                        <div class="col-lg-8">
                            <input  id="lregno" type="text" class="form-control">
                        </div>
                    </div>




                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-lg-4"></div>
            <div class="col-lg-4" align="center">
                <button type="button" class="btn btn-primary" onclick="search()">查 询</button>
            </div>
            <div class="col-lg-4"></div>
        </div>
        <hr/>
    </form>

    <div class="row" >
            <div class="tableinfo">
                <table id="resultTable" >
                    <thead>
                    </thead>
                    <!--class="row-border hover order-column" cellspacing="0" width="100%"-->
                    <!--<thead>-->
                    <!--&lt;!&ndash;<tr>&ndash;&gt;-->
                        <!--&lt;!&ndash;<th>参考编号</th>&ndash;&gt;-->
                        <!--&lt;!&ndash;<th>客户号</th>&ndash;&gt;-->
                        <!--&lt;!&ndash;<th>中文名字</th>&ndash;&gt;-->
                        <!--&lt;!&ndash;<th>贷款申请状态</th>&ndash;&gt;-->
                        <!--&lt;!&ndash;<th>证件号码/注册登记号</th>&ndash;&gt;-->
                        <!--&lt;!&ndash;<th>申请日期</th>&ndash;&gt;-->
                    <!--&lt;!&ndash;</tr>&ndash;&gt;-->
                    <!--</thead>-->
                    <!--<tbody id="searchInfoTable">-->
                    <!--</tbody>-->

                </table>
            </div>
        </div>

</div>




<iframe id="iframeMapping" src=""  ></iframe>


<!-- Bootstrap Core JavaScript -->
<script th:src="@{/vendor/bootstrap/js/bootstrap.min.js}" ></script>

<!-- Metis Menu Plugin JavaScript -->
<script th:src="@{/vendor/metisMenu/metisMenu.min.js}"></script>

<!-- Custom Theme JavaScript -->
<script th:src="@{/dist/js/sb-admin-2.js}"></script>



</body>

</html>